<?php
/* PHP SDK
 * @version 2.0.0
 * @author connect@qq.com
 * @copyright © 2013, Tencent Corporation. All rights reserved.
 */

class Recorder{
    private $inc;
    private $error;

    public function __construct(){
        $this->error = new ErrorCase();
		require ROOT_PATH.'setting/qq.php';
        //-------读取配置文件
        $this->inc = $config['qq'];
        if(empty($this->inc)){
            $this->error->showError("20001");
        }
        session_start();
    }

    public function write($name,$value){
        $_SESSION['qq_oauth'][$name]=$value;
    }

    public function read($name){
        return $_SESSION['qq_oauth'][$name];
    }

    public function readInc($name){
        if(empty($this->inc[$name])){
            return null;
        }else{
            return $this->inc[$name];
        }
    }

    public function delete($name){
        $_SESSION['qq_oauth'][$name]=null;
        unset($_SESSION['qq_oauth'][$name]);
    }
}
